package com.xiaohai.wx.weather.dto;

import java.lang.reflect.Field;

import org.joda.time.LocalDate;


public class Weather {

	private LocalDate date;
	private String tempHigh;
	private String tempLow;
	private String tempChange;
	private String weather;
	private String wind;
	private String index_dress; 
	private String index_uv;//紫外线
	private String index_xc; //wash car
	private String index_tr; // travel
	private String aqi_index;
	private String air_quality;
	
	public String toString(){
		StringBuilder builder = new StringBuilder();
		try {
			//builder.append("")
			Field[] ff = this.getClass().getDeclaredFields();
			for(int i = 0; i<ff.length; i++){
				String fieldName = ff[i].getName();
				//System.out.println(fieldName);
				String fieldValue = "";
				if(fieldName.equals("date")){
					fieldValue = ((LocalDate) ff[i].get(this)).toString();
				}else{
					fieldValue =(String) ff[i].get(this);
				}
				
				builder.append(fieldName + " : "+ fieldValue +"\n");
				
			}
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (SecurityException e) {
			e.printStackTrace();
		} 
		return builder.toString();
	}

	public String getHighTemp() {
		return tempHigh;
	}
	public void setHighTemp(String temp) {
		this.tempHigh = temp;
	}
	
	public String getLowTemp() {
		return tempLow;
	}
	public void setLowTemp(String temp) {
		this.tempLow = temp;
	}
	
	public String getWeather() {
		return weather;
	}
	public void setWeather(String weather) {
		this.weather = weather;
	}
	public String getWind() {
		return wind;
	}
	public void setWind(String wind) {
		this.wind = wind;
	}
	
	public String getChinaDate(){
		return date.toString("MM月dd日 E");
	}
	
	public String getIndex_dress() {
		return index_dress;
	}
	public void setIndex_dress(String index_dress) {
		this.index_dress = index_dress;
	}
	public String getIndex_uv() {
		return index_uv;
	}
	public void setIndex_uv(String index_uv) {
		this.index_uv = index_uv;
	}
	public String getIndex_xc() {
		return index_xc;
	}
	public void setIndex_xc(String index_xc) {
		this.index_xc = index_xc;
	}
	public String getIndex_tr() {
		return index_tr;
	}
	public void setIndex_tr(String index_tr) {
		this.index_tr = index_tr;
	}
	
	public LocalDate getDate() {
		return date;
	}
	public void setDate(LocalDate date) {
		this.date = date;
	}

	public String getAqi_Index() {
		return aqi_index;
	}

	public void setAqi_Index(String aqi) {
		this.aqi_index = aqi;
	}

	public String getAir_quality() {
		return air_quality;
	}

	public void setAir_quality(String air_quality) {
		this.air_quality = air_quality;
	}
	
	public String getTempChange(){
		return tempChange;
	}
	
	public void setTempChange(String input){
		tempChange = input;
	}
		
}
